//
//  WebConnetionArray.h
//  Growth
//
//  Created by  on 12-2-9.
//  Copyright (c) 2012年 MEETStudio. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WebRequest.h"
#import "SDDataCache.h"


@protocol WebConnectionArrayDelegate;

@interface WebConnectionArray : NSObject {
	NSMutableData *jsonData;
    
    //做本地数据库缓存
    NSString *dataBaseListName;
    
    //reuqust type
    NSString *connectionURL;
    
    
    int  statusCode;
    
}

@property (assign) id<WebConnectionArrayDelegate> connectionDelegate; 

@property (nonatomic, retain) NSMutableData *jsonData;

@property (nonatomic,retain)  NSString *dataBaseListName;

@property (nonatomic,retain)    NSString *connectionURL;



- (id)initWith:(NSMutableURLRequest *)request delegate:(id)delegate dataBaseListName:(NSString *)listName;


- (void)connectionFinished:(NSDictionary *)feedDictionary  connectionURL:(NSString *)url;

//数据数据缓存

- (void) saveDataToDatabaseWithType:(NSString *)listType stringData:(NSString *)stringData;


//上传离线记录
-(void)upTheLocalDiary;


@end


@protocol WebConnectionArrayDelegate <NSObject>
@optional 

- (void)connectionArraySuccess:(NSDictionary *)dict  connectionURL:(NSString *)url;
- (void)connectionArrayError:(NSError *)error;
- (void)connectionArrayError:(NSError *)error connectionURL:(NSString *)url;



@end